//注册操作
$(function () {
    var registerUrl = '/online/user/registeruserpageinfo';
    var userName = $.trim($("#username").val());
    var schoolNumber=$("#schoolNumber").val();
    var schoolPassword = $("#schoolPassword").val();

    if ($.trim(userName) == "") {

        Tip('用户名不能为空');
        $("#userName").focus();
        return;

    }
    if ($.trim(schoolNumber) == "") {

        Tip('教务处账号不能为空');
        $("#schoolNumber").focus();
        return;

    }
    if ($.trim(schoolPassword) == "") {

        Tip('教务处密码不能为空');
        $("#schoolPassword").focus();
        return;

    }

        // 访问后台进行登录验证
        $.ajax({
            url : registerUrl,
            type : "post",
            dataType : 'json',
            data : {
                userName : userName,
                schoolNumber : schoolNumber,
                schoolPassword : schoolPassword,
            },
            success : function(data) {
                if (data.success) {
                    console.log(user);
                    $.toast('注册成功！');
                    window.location.href = '/online/front/login';
                } else {
                    $.toast('登录失败！' + data.errMsg);
                    window.location.href = '/online/front/index';
                }
            }
        });
}
)






